using BasicScript.Component;
using Game.Const;
using Game.Core;
using Game.Main.Controller;
using Game.Manager;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

namespace Game.Main.View
{
	//public class PurchaseView : BaseView
	//{
	//	private SceneController clr;

	//	private const int STEP_NUM = 9;

	//	public PurchaseView(SceneController clr)
	//		: base("prefabs/ui/scene/purchaseview", Singleton<UIManager>.Instance.uiLayer)
	//	{
	//		viewName = "PurchaseView";
	//		this.clr = clr;
	//		isHideScene = true;
	//	}

	//	protected override void OnLoaded()
	//	{
	//		GameObject gameObject = GetChild("BtnClose").gameObject;
	//		ButtonObject btnCloseScript = gameObject.AddComponent<ButtonObject>();
	//		btnCloseScript.InitParams(1.25f, 1.25f, 1f, 1f);
	//		UIEventSystem.Get(gameObject).AddEventListener(EventTriggerType.PointerDown, delegate
	//		{
	//			Singleton<AudioManager>.Instance.PlaySound("sound_btn_1");
	//			btnCloseScript.ZoomIn();
	//		});
	//		UIEventSystem.Get(gameObject).AddEventListener(EventTriggerType.PointerExit, delegate
	//		{
	//			btnCloseScript.ZoomOut();
	//		});
	//		UIEventSystem.Get(gameObject).AddEventListener(EventTriggerType.PointerUp, delegate
	//		{
	//			btnCloseScript.ZoomOut();
	//		});
	//		UIEventSystem.Get(gameObject).AddEventListener(EventTriggerType.PointerClick, delegate
	//		{
	//			clr.OCPurchaseView(false, false);
	//		});
	//		Transform child = GetChild("Block1");
	//		GameObject gameObject2 = child.Find("BtnPurchase").gameObject;
	//		if (Singleton<SaveManager>.Instance.IsUnlock)
	//		{
	//			child.Find("Image").GetComponent<Image>().material = new Material(Shader.Find("Custom/UIGrey"));
	//			gameObject2.GetComponent<Image>().material = new Material(Shader.Find("Custom/UIGrey"));
	//			Object.Destroy(gameObject2.GetComponent<Button>());
	//		}
	//		else
	//		{
	//			UIEventSystem.Get(gameObject2).AddEventListener(EventTriggerType.PointerDown, OnBtnPurchaseDown);
	//			UIEventSystem.Get(gameObject2).AddEventListener(EventTriggerType.PointerClick, OnBtnPurchaseClick);
	//		}
	//		if (string.IsNullOrEmpty(Singleton<PurchasingManager>.Instance.unlockAllPrice))
	//		{
	//			gameObject2.transform.Find("Text").GetComponent<Text>().text = "GO";
	//		}
	//		else
	//		{
	//			gameObject2.transform.Find("Text").GetComponent<Text>().text = Singleton<PurchasingManager>.Instance.unlockAllPrice;
	//		}
	//		Transform transform = child.Find("TxtTitle");
	//		transform.GetComponent<Text>().text = TextConst.TEXT_5;
	//		Transform transform2 = child.Find("TxtDescription");
	//		transform2.GetComponent<Text>().text = TextConst.TEXT_6;
	//		if (Application.systemLanguage == SystemLanguage.Russian)
	//		{
	//			transform2.GetComponent<Text>().fontSize = 22;
	//			transform2.GetComponent<Text>().lineSpacing = 1f;
	//		}
	//		GameObject gameObject3 = GetChild("BtnRestore").gameObject;
	//		UIEventSystem.Get(gameObject3).AddEventListener(EventTriggerType.PointerDown, OnBtnRestoreDown);
	//		UIEventSystem.Get(gameObject3).AddEventListener(EventTriggerType.PointerClick, OnBtnRestoreClick);
	//		Text component = gameObject3.transform.Find("Text").GetComponent<Text>();
	//		component.text = TextConst.TEXT_1;
	//	}

	//	private void OnBtnPurchaseDown(BaseEventData evt)
	//	{
	//		Singleton<AudioManager>.Instance.PlaySound("sound_btn_1");
	//	}

	//	private void OnBtnPurchaseClick(BaseEventData evt)
	//	{
	//		clr.OCValidationView(true, true, 1);
	//	}

	//	private void OnBtnRestoreDown(BaseEventData evt)
	//	{
	//		Singleton<AudioManager>.Instance.PlaySound("sound_btn_1");
	//	}

	//	private void OnBtnRestoreClick(BaseEventData evt)
	//	{
	//		clr.OCValidationView(true, true, 2);
	//	}
	//}
}
